import scala.io.StdIn._
object Practise2{
  def isPalindrome(str: String): Boolean = {
    val len = str.length
    val halfLen = len / 2
    for (i <- 0 until halfLen) {
      if (str(i) != str(len - i - 1)) {
        return false
      }
    }
    true
  }
  def main(args:Array[String]):Unit={
    print("请输入一个字符串:")
    var str=readLine()
    println(isPalindrome(str))
  }
}

